package pers.fulsun.es.test._03_doc;

import java.io.IOException;
import org.elasticsearch.action.delete.DeleteRequest;
import org.elasticsearch.action.delete.DeleteResponse;
import org.elasticsearch.client.RequestOptions;
import org.elasticsearch.client.RestHighLevelClient;
import pers.fulsun.es.test._01_ESClient;

public class _04_ESTest_Doc_Delete {
  private static RestHighLevelClient client = _01_ESClient.getClient();

  public static void main(String[] args) throws IOException {

    DeleteRequest request = new DeleteRequest();
    request.index("user").id("1001");

    DeleteResponse response = client.delete(request, RequestOptions.DEFAULT);
    System.out.println(response.toString());

    // 关闭客户端连接
    client.close();
  }
}
